import { http } from '@/common/https.js'

// 获取我的出入库列表
export const getMyInOutListApi = (data, type = 'inorder') => {
  return http({
    url: `/logistics/${type}/list`,
    method: "get",
    data,
    custid: true
  })
}

// 获取月台列表
export const getPlatformListApi = (data) => {
  return http({
    url: `/logistics/platform/list`,
    method: "get",
    data
  })
}

// 删除出入库列表
export const deleteInOutListApi = (id, type = 'inorder') => {
  return http({
    url: `/logistics/${type}/${id}`,
    method: "DELETE"
  })
}

// 获取出入库货物列表
export const getInOutGoodsListApi = (data, type = 'inorderdetail') => {
  return http({
    url: `/logistics/${type}/list`,
    method: "get",
    data
  })
}

// 获取商品详情
export const getInorderdetailApi = (id, type = 'inorderdetail') => {
  return http({
    url: `/logistics/${type}/${id}`,
    method: "get"
  })
}

// 删除出入库货物
export const deleteInOutGoodsApi = (id, type = 'inorderdetail') => {
  return http({
    url: `/logistics/${type}/${id}`,
    method: "DELETE"
  })
}

// 出入库订单确认收货(新增)
export const confirmReceiptApi = (data, type) => {
  return http({
    url: `/logistics/${type}`,
    method: "post",
    data,
    userid: true
  })
}
// 出入库订单确认收货(修改)
export const confirmReceiptUpdateApi = (data, type) => {
  return http({
    url: `/logistics/${type}`,
    method: "put",
    data,
    userid: true
  })
}

// 获取出入库操作日志列表
export const getInOutLogListApi = (data, type = 'inorderlog') => {
  return http({
    url: `/logistics/${type}/list`,
    method: "get",
    data
  })
}

// 订单出库通知
export const orderOutNoticeApi = (data) => {
  return http({
    url: `/logistics/alert`,
    method: "post",
    data,
  })
}